Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(opensearch-sink) Setting 'insecure' should override 'cert' #5268

Merged

Conversation

janhoy
Copy link
Contributor

@janhoy janhoy commented Dec 17, 2024

Description

This PR flips the precedence between cert and insecure config options so that insecure: true overrides the presence of cert.

Issues Resolved

Resolves #5267

Check List

  • New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@janhoy janhoy force-pushed the insecure-overrides-certpath branch from e9797f2 to 2a58b26 Compare December 17, 2024 11:16
@@ -118,7 +118,7 @@ Default is null.

- `aws_sts_header_overrides`: An optional map of header overrides to make when assuming the IAM role for the sink plugin.

- `insecure`: A boolean flag to turn off SSL certificate verification. If set to true, CA certificate verification will be turned off and insecure HTTP requests will be sent. Default to `false`.
- `insecure`: A boolean flag to turn off SSL certificate verification. If set to true, CA certificate verification will be turned off and insecure HTTP requests will be sent. Setting this will override any `cert` configured. Default to `false`.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the same documentation clarification on the source side as on the sink side. Peeking in the configuration code for source, it appears that insecure: true already overrides cert, so this is just a clarification.

builder = builder.withInsecure(insecure);
// Insecure == true will override configured certPath
if (insecure) {
builder.withInsecure(insecure);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found no way to log a warning if both options are configured at the same time, so this is just a silent override.

@janhoy janhoy changed the title Setting 'insecure' should override 'certPath' bug(opensearch-sink) Setting 'insecure' should override 'cert' Dec 17, 2024
Copy link
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @janhoy for this contribution to the project!

@dlvenable dlvenable merged commit c614f95 into opensearch-project:main Jan 10, 2025
66 of 68 checks passed
jcrean pushed a commit to jcrean/data-prepper that referenced this pull request Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG][opensearch sink] Config option 'insecure' not honored when 'cert' is configured
3 participants